window.onload = function(){
	load("xml/swarm.xml", libLoaded, true, false, true, true);
};

//
var libLoaded = function(src){
	swarmInsert(obj("swarmLayer"), src, "/lib/swarm[@id='test']");
	
	swarmRender(obj("swarmLayer"), obj("canvas"), obj("s2"));
	
	var onDragStep = function(focusObj){
		swarmRender(obj("swarmLayer"), obj("canvas"), focusObj);
	};
	
	document.onmousedown = function(e){
		startDrag(e, onDragStep);
		// prevent text selection in IE
		document.onselectstart = function(){return false;};
	    // prevent text selection (except IE)
	    return false;
	};	
};